//防抖
function debounce(fn, wait) {
  let timeout = null;
  return function() {
    let context = this;
    let args = arguments;
    if (timeout) clearTimeout(timeout);
    let callNow = !timeout;
    timeout = setTimeout(() => {
      timeout = null;
    }, wait);
    if (callNow) fn.apply(context, args);
  };
}
//去除rich-text标签中的img标签
function removeImageTags(html) {
  // 正则表达式匹配image标签
  let regex = /<img[^>]*>/gi;
  // 使用空字符串替换匹配到的image标签，从而删除它们
  let newContent = html.replace(regex, '');
  return newContent;
}
export {debounce,removeImageTags}